home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh -e
-
- . /usr/share/debconf/confmodule
-
- METADICDIR=/usr/share/anthy/dic
- #ADDONDICDIR=/var/lib/anthy/
- DICLIST=/var/cache/anthy/diclist
- DICFILE=''
-
- if [ ! -d /var/cache/anthy ]; then
- mkdir -m 755 /var/cache/anthy
- fi
-
- if [ -f $DICLIST ]; then
- if [ -f "$DICLIST"-old ]; then
- rm -f "$DICLIST-old"
- fi
- mv "$DICLIST" "$DICLIST-old"
- fi
-
- cat << ENDOFLIST > $DICLIST
- 2ch.t
- base.t
- extra.t
- ENDOFLIST
-
- #OLDDIR=`pwd`; cd $METADICDIR
- #for file in *; do
- # case $file in
- # *.t)
- # if test -f $file; then
- # echo $file >> $DICLIST
- # fi
- # ;;
- # esac
- #done
- #cd $OLDDIR
-
- #for file in $ADDONDICDIR/*; do
- # case $file in
- # *.t)
- # if test -f $file; then
- # DICFILE="$DICFILE\n$file"
- # fi
- # ;;
- # esac
- #done
-
- if [ -f "$DICLIST"-old ]; then
- if diff -q "${DICLIST}"-old "${DICLIST}" > /dev/null 2>&1; then
- # old file and new file are identical
- rm -f "$DICLIST-old"
- else
- db_get anthy/reconf
- if [ "$RET" = "true" ]; then
- db_fset anthy/dictionaries seen false
- fi
- fi
- fi
-
- DICS=$(sort -u "$DICLIST" | tr '\n' ' ' \
- | sed 's/\ /,\ /g' | sed 's/,\ $//g')
-
- db_capb backup
-
- db_subst anthy/dictionaries dictionaries "$DICS"
-
- while [ "$GO" != "ok" ]; do
- db_input medium anthy/dictionaries || true
- if db_go; then
- GO=ok
- fi
- done
-
- db_input medium anthy/reconf || true
- db_go || true
-